﻿<UserControl x:Class="ABCat.Plugins.NormalizationSettingsEditor.Standard.NormalizationSettingsViewerUc"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:standard="clr-namespace:ABCat.Plugins.NormalizationSettingsEditor.Standard"
             xmlns:converters="clr-namespace:ABCat.Core.Converters;assembly=ABCat.Core"
             d:DataContext="{d:DesignInstance standard:NormalizationViewerViewModel}"
             d:DesignHeight="300"
             d:DesignWidth="300"
             mc:Ignorable="d">
	<UserControl.Resources>
		<converters:ValueToVisibilityConverter x:Key="Vvc"/>
		<BooleanToVisibilityConverter x:Key="btvc" />
	</UserControl.Resources>
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="1*" />
		</Grid.RowDefinitions>
		<TreeView x:Name="Tree"
		          Grid.Row="0"
		          Margin="2"
		          Background="Transparent"
		          BorderBrush="{x:Null}"
		          ItemsSource="{Binding ReplacementTreeSource}">
			<TreeView.ItemTemplate>
				<HierarchicalDataTemplate DataType="{x:Type standard:ReplacementTreeNode}" ItemsSource="{Binding Children}">
					<StackPanel Orientation="Horizontal">
						<Grid Visibility="{Binding Path=CanHide, Converter={StaticResource Vvc}, ConverterParameter=True}">
							<Button Background="Transparent"
						        BorderThickness="0"
								Visibility="{Binding IsHidden, Converter={StaticResource Vvc}, ConverterParameter=False}"
						        Command="{Binding Path=HideCommand}">
								<Path Width="20"
							      Height="10"
														Fill="Black" Data="M33.597977,10.759002C37.946865,10.759002 41.485962,14.285001 41.485962,18.649 41.485962,23 37.946865,26.535 33.597977,26.535 29.23909,26.535 25.709992,23 25.709992,18.649 25.709992,17.784 25.849955,16.953001 26.109888,16.174002 26.779719,16.881001 27.70948,17.327002 28.759213,17.327002 30.778696,17.327002 32.418278,15.691001 32.418278,13.668001 32.418278,12.663001 32.008381,11.748001 31.348551,11.087002 32.058369,10.876001 32.818176,10.759002 33.597977,10.759002z M33.606682,4.3679962C25.92741,4.3679957 19.698065,10.594956 19.698065,18.27293 19.698065,25.953894 25.92741,32.177862 33.606682,32.177862 41.295838,32.177862 47.515175,25.953894 47.515175,18.27293 47.515175,10.594956 41.295838,4.3679957 33.606682,4.3679962z M34.867642,1.546141E-09C36.890393,2.6508449E-05 58.705193,0.41938579 68.893006,18.299923 68.893006,18.299923 57.1442,36.139837 34.44656,34.768854 34.44656,34.768854 14.428583,36.59984 0,18.299923 0,18.299923 9.0791523,0.4590019 34.716553,0.0010111886 34.716553,0.0010114873 34.768162,-1.4442128E-06 34.867642,1.546141E-09z" Stretch="Uniform"/>
								</Button>
							<Button Background="Transparent"
						        BorderThickness="0"
						        Command="{Binding Path=UnHideCommand}"
								Visibility="{Binding IsHidden, Converter={StaticResource Vvc}, ConverterParameter=True}">
								<Path
									Width="20"
							      Height="10"
										Fill="LightGray" Data="M33.597977,10.759002C37.946865,10.759002 41.485962,14.285001 41.485962,18.649 41.485962,23 37.946865,26.535 33.597977,26.535 29.23909,26.535 25.709992,23 25.709992,18.649 25.709992,17.784 25.849955,16.953001 26.109888,16.174002 26.779719,16.881001 27.70948,17.327002 28.759213,17.327002 30.778696,17.327002 32.418278,15.691001 32.418278,13.668001 32.418278,12.663001 32.008381,11.748001 31.348551,11.087002 32.058369,10.876001 32.818176,10.759002 33.597977,10.759002z M33.606682,4.3679962C25.92741,4.3679957 19.698065,10.594956 19.698065,18.27293 19.698065,25.953894 25.92741,32.177862 33.606682,32.177862 41.295838,32.177862 47.515175,25.953894 47.515175,18.27293 47.515175,10.594956 41.295838,4.3679957 33.606682,4.3679962z M34.867642,1.546141E-09C36.890393,2.6508449E-05 58.705193,0.41938579 68.893006,18.299923 68.893006,18.299923 57.1442,36.139837 34.44656,34.768854 34.44656,34.768854 14.428583,36.59984 0,18.299923 0,18.299923 9.0791523,0.4590019 34.716553,0.0010111886 34.716553,0.0010114873 34.768162,-1.4442128E-06 34.867642,1.546141E-09z" Stretch="Uniform"/>
								</Button>
						</Grid>
						<Rectangle StrokeThickness="0" Fill="Transparent" Width="20" Height="10" Visibility="{Binding Path=CanHide, Converter={StaticResource Vvc}, ConverterParameter=False}"/>
						<TextBlock Margin="0,0,5,0" Text="{Binding}" />
						<Button Background="Transparent"
						        BorderThickness="0"
						        Command="{Binding RelativeSource={RelativeSource AncestorType=standard:NormalizationSettingsViewerUc},
						                          Path=DataContext.RemoveItemCommand}"
						        CommandParameter="{Binding RelativeSource={RelativeSource Self},
						                                   Path=DataContext}"
						        Visibility="{Binding Path=CanRemove,
						                             Converter={StaticResource btvc}}">
							<Path Width="10"
							      Height="10"
							      Data="M51.527958,0L64,12.4741 44.47221,32.001027 64,51.52871 51.528,64.000001 32.000016,44.472668 12.471823,64.000001 0.0010004044,51.528802 19.528015,32.001088 0,12.473726 12.472,0.0010004044 31.999884,19.528773z"
							      Fill="#FF060044"
							      Stretch="Uniform" />
						</Button>
					</StackPanel>
				</HierarchicalDataTemplate>
			</TreeView.ItemTemplate>
		</TreeView>
		<StackPanel Grid.Row="0"
		            Margin="10"
		            HorizontalAlignment="Center"
		            VerticalAlignment="Center"
		            Visibility="{Binding IsEmpty,
		                                 Converter={StaticResource btvc}}">
			<TextBlock Text="Список автозамены пока пуст."
			           TextAlignment="Center"
			           TextWrapping="Wrap" />
			<TextBlock Text="Для добавления значений в список автозамены выделите в списке записи, содержащие значения, которые нуждаются в автоматической замене."
			           TextAlignment="Center"
			           TextWrapping="Wrap" />
			<TextBlock Text="После этого через контекстное меню списка выберите команду редактирования списка автозамены."
			           TextAlignment="Center"
			           TextWrapping="Wrap" />
			<TextBlock Text="После этого откроется редактор автозамены."
			           TextAlignment="Center"
			           TextWrapping="Wrap" />
		</StackPanel>
	</Grid>
</UserControl>
